virtual mesh *ray_intersect(vector& ro,vector& rd,vector& ip,float& dist,int& facenum,float rad=0.0f)
Parameter | Type | Description |
---|---|---|
ro | vector& | ray origin |
rd | vector& | ray direction |
ip | vector& | intersection point |
dist | float& | intersection distance |
facenum | int& | intersected face index |
rad | float | collision radius |
Returns the intersected mesh or NULL for no intersection.
This virtual function implements a ray intersection with the object. It should return the closest collision.
Its default behavior is to call get_mesh and if it returns a mesh, call the mesh ray_intersect.